$(document).ready(function() {
	var id = getvl("id");
	getUserDetail(id);
});

/*
 * 获取用户详情
 */
function getUserDetail(id) {
	$.ajax({
		url: urlcore + "/api/cashRecord/getWithdrawDetail?id=" + id,
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success: function(data) {
			if(data.success == true) {
				var da = data.data;
				$('#real_name').val(da.user.realName);
				$('#phone').val(da.user.phone);
				$('#payment_num').val(da.paymentNum);
				$('#bank_card_name').val(da.bankCardName);
				$('#bank_name').val(da.bankName);
				$('#money').val(da.money);
				$('#merchant_num').val(da.merchantNum);
				$('#transaction_num').val(da.transactionNum);
				$('#upt_datetime').val(da.uptDatetime);
				var withdraw_status;
				if(da.withdrawStatus == 1){
					withdraw_status = "申请中";
				}else if(da.withdrawStatus == 2){
					withdraw_status="已打款";
				}else if(da.withdrawStatus == 3){
					withdraw_status="拒绝";
				}else if(da.withdrawStatus == 4){
					withdraw_status="提现失败";
				}
				$('#withdraw_status').val(withdraw_status);
				
				
			} else if(data.code == 'OVERTIME') {
				var thisUrl = window.location.href;
				if(thisUrl.indexOf('login.html') <= -1) {
					top.window.location.href = "login.html";
				}
			} else {
				alert(data.msg);
			}
		},
		error: function() {
			/* Act on the event */
			alert("error");
		}
	});
}
